<template>
  <div class="record">
    <CustomTable height="965rem" ref="tableRef" type="index" :showPagination="false" :tableHeader="tableHeader" api="/znjszd3/ht/grdmjlcx/getDmjsList">
      <template v-slot:lastColumn="{ row }">
        <el-button type="primary" plain @click.stop="view(row)">
          <el-icon><View /></el-icon>
          查看</el-button
        >
      </template>
    </CustomTable>
    <CustomDialog title="点名详情" v-model:dialogVisible="dialogVisible" top="9vh" height="900rem" @confirm="dialogVisible = false" confirmText="关闭">
      <CustomTable height="750rem" type="index" :showPagination="false" :tableHeader="tableHeader2" api="/znjszd3/ht/grdmjlcx/getDmryList" :params="params">
        <template #zpurl="{ row }">
          <PhotoScale :src="row.zpurl" />
        </template>
        <template #bdjg="{ row }">
          <span v-if="row.bdjg == '成功'" style="color: #67c23a">{{ row.bdjg }}</span>
          <span v-else style="color: red">{{ row.bdjg }}</span>
        </template>
        <template #bdtpurl="{ row }">
          <PhotoScale :src="row.bdtpurl" />
        </template>
      </CustomTable>
    </CustomDialog>
  </div>
</template>

<script setup name="personCallNameRecord">
import { ref, onBeforeMount, onMounted, computed, watch, onBeforeUnmount } from 'vue'
const props = defineProps({})
const dialogVisible = ref(false)

const params = ref({
  dmjsid: ''
})
const tableHeader = ref([
  {
    key: 'jszw',
    label: '监室号'
  },
  {
    key: 'kssj',
    label: '开始时间'
  },
  {
    key: 'jssj',
    label: '结束时间'
  },
  {
    key: 'timemin',
    label: '点名时长'
  },
  {
    key: 'ydrs',
    label: '应到人数'
  },
  {
    key: 'sdry',
    label: '实到人数'
  },
  {
    key: 'bgr',
    label: '点名者'
  }
])
const tableHeader2 = ref([
  {
    key: 'xm',
    label: '姓名'
  },
  {
    key: 'jszw',
    label: '监室号'
  },
  {
    key: 'zpurl',
    label: '照片'
  },

  {
    key: 'dmcs',
    label: '点名次数'
  },
  {
    key: 'resulttime',
    label: '签到时间'
  },
  {
    key: 'bdjg',
    label: '比对结果'
  },
  {
    key: 'bdtpurl',
    label: '比对照片'
  },

  {
    key: 'bz',
    label: '备注'
  }
])
const view = (row) => {
  params.value.dmjsid = row.id
  dialogVisible.value = true
}
</script>
<style lang="scss" scoped></style>
